﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.Utils;

namespace ProgramMain.Framework
{
    public partial class BaseListViewCtl : ProgramMain.Framework.BaseListCtl
    {
        public BaseListViewCtl()
        {
            InitializeComponent();

            this.biAdd.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biAdd_ItemClick);
            this.biEdit.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biEdit_ItemClick);
            this.biDetails.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biDetails_ItemClick);
            this.biDelete.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biDelete_ItemClick);
            this.biCopy.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biCopy_ItemClick);
            this.biRefresh.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biRefresh_ItemClick);
            this.biConnection.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biConnection_ItemClick);
            this.biVertexMap.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biVertexMap_ItemClick);
            this.biPath.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biPath_ItemClick);
            this.biPathMap.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biPathMap_ItemClick);
            this.biAddDocument.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(biAddDocument_ItemClick);
            this.biDocumentList.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(biDocumentList_ItemClick);
        }

        private void biAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Action_Add(sender, EventArgs.Empty);
        }

        private void biEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Action_Edit(sender, EventArgs.Empty);
        }

        private void biDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Action_Delete(sender, EventArgs.Empty);
        }

        private void biRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Action_Refresh(sender, EventArgs.Empty);
        }

        protected virtual void biDetails_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
        }

        protected virtual void biCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
        }

        protected virtual void biConnection_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
        }

        protected virtual void biVertexMap_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        protected virtual void biPath_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        protected virtual void biPathMap_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        protected virtual void biDocumentList_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        protected virtual void biAddDocument_ItemClick(object sender, ItemClickEventArgs e)
        {
        }

        protected void UpdateStatusText(DataTable table)
        {
            this.biStatusText.Caption = "Количество записей: " + table.Rows.Count.ToString();
        }
    }
}
